package com.lnking.lnkingplace.service.impl;


import com.lnking.lnkingplace.mapper.PlaceAttractionsMapper;
import com.lnking.lnkingplace.model.entity.PlaceAttractions;
import com.lnking.lnkingplace.model.request.place.attractions.AttractionsAddRequest;
import com.lnking.lnkingplace.model.request.place.attractions.AttractionsUpdateRequest;
import com.lnking.lnkingplace.service.IPlaceAttractionsService;
import com.lnking.starter.mybatis.service.impl.CustomServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author sn
 * @since 2022-09-22
 */
@Service
public class PlaceAttractionsServiceImpl extends CustomServiceImpl<PlaceAttractionsMapper, PlaceAttractions> implements IPlaceAttractionsService {

    @Override
    public void add(AttractionsAddRequest params) {
        PlaceAttractions placeAttractions = new PlaceAttractions();
        BeanUtils.copyProperties(params,placeAttractions);
        getBaseMapper().insert(placeAttractions);
    }

    @Override
    public void update(AttractionsUpdateRequest params) {
        PlaceAttractions placeAttractions = new PlaceAttractions();
        BeanUtils.copyProperties(params,placeAttractions);
        getBaseMapper().updateById(placeAttractions);
    }
}
